import request from "@/utils/request";
import type { CourseReviewAuditHistory, CourseReviewPageQuery } from "../review/course-review/type";
import type { ConsultantReview } from "./type";

/*
 * @Author: anxia.ack anchenkai@come-future.com
 * @Date: 2025-05-07 22:21:17
 * @LastEditors: anxia.ack anchenkai@come-future.com
 * @LastEditTime: 2025-05-07 22:38:26
 * @FilePath: /free-learning/src/api/consultant_review/index.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
const BASE_URL = "/api/v1/consultant/review";

export const page = (data: CourseReviewPageQuery): Promise<MyPageResult<ConsultantReview>> => {
  return request.post(`${BASE_URL}/page`, data);
};

export const audit = (data: ConsultantReview): Promise<boolean> => {
  return request.put(`${BASE_URL}/audit`, data);
};

export const auditList = (reviewId: number): Promise<CourseReviewAuditHistory[]> => {
  return request.get(`${BASE_URL}/review/audit/history/${reviewId}`);
};
